package com.example.demo.mapper;

import com.example.demo.dto.SearchInfo;
import com.example.demo.entity.Danweixinxi;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository()
public interface Danweixinxi_Mapper extends BaseMapper<Danweixinxi>{
	
	@Select("SELECT Danweixinxi.* "
	        + "FROM Danweixinxi  ${where} ${limitstr}")
	public List<Danweixinxi> select(SearchInfo info);
	
	@Select("SELECT COUNT(1) FROM Danweixinxi ${where}")
	public long selectCount(SearchInfo info);
	
	@Insert("INSERT INTO Danweixinxi (danweiname, lianxiphone) VALUES (#{danweiname}, #{lianxiphone})")
	public void insert(Danweixinxi Danweixinxi);
	
	@Update("UPDATE Danweixinxi SET danweiname = #{danweiname}, lianxiphone = #{lianxiphone} "
	        + " WHERE id = #{id}")
	public void update(Danweixinxi Danweixinxi);
	
	
	@Delete("DELETE FROM Danweixinxi WHERE id = #{id}")
	public void delete(int id);
	
	@Select("SELECT * FROM Danweixinxi WHERE id = #{id}")
	public Danweixinxi selectById(int id);

	@Update("update danweixinxi set chukucishu=(chukucishu+1)")
    void addone1();
	@Update("update danweixinxi set rukucishu=(rukucishu+1)")
	void addone2();
}
